package cn.it.ygh.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.it.ygh.pojo.House;
import cn.it.ygh.service.IndexService;

@Controller
@RequestMapping("index")
public class IndexController {
	
	@Resource
	private IndexService indexService;
	
	@RequestMapping(value="getLastestInfo.do",method = RequestMethod.GET)
	@ResponseBody
	public Map<Object,Object> getLastestInfo()
	{
		Map<Object, Object> map = new HashMap<Object, Object>();
		List<House> houseList = indexService.getLastestInfo();
		map.put("houseList", houseList);
		return map;
	}
}
